package com.kzw.oa.blog.model;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.kzw.misc.annotation.S;
import com.kzw.misc.annotation.T;
import com.kzw.oa.system.model.AppUser;
import com.kzw.oa.system.model.Dictionary;

@Entity
@Table(name = "article")
public class Article {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long oid;

	@T("文章标题")
	@S
	private String title;

	@T("文章内容")  //Ueditor
	@Lob
	private String content;

	@T("状态")
	@S("[[0, '禁用'], [1, '激活']]")
	private int status;

	@T("文章类型")
	@ManyToOne
	@JoinColumn(name = "type")
	private Dictionary type;

	@T("作者")
	@ManyToOne
	@JoinColumn
	private AppUser author;

	@T("发表时间")
	private Date ctime = new Date();

	public Long getOid() {
		return oid;
	}

	public void setOid(Long oid) {
		this.oid = oid;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Dictionary getType() {
		return type;
	}

	public void setType(Dictionary type) {
		this.type = type;
	}

	public AppUser getAuthor() {
		return author;
	}

	public void setAuthor(AppUser author) {
		this.author = author;
	}

	public Date getCtime() {
		return ctime;
	}

	public void setCtime(Date ctime) {
		this.ctime = ctime;
	}

}
